﻿using GedeaProject.Business.Parsers.Helpers;
using GedeaProject.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GedeaProject.Business.Parsers
{
    internal class CustomerTextDebitParser
    {
        private Customer customer;
        private AreaTextDebitParser areaParser;

        internal CustomerTextDebitParser(Customer customer)
        {
            this.customer = customer;
            this.areaParser = new AreaTextDebitParser(customer.Area);
        }

        internal string InternalBankCode
        {
            get
            {
                return this.customer.Cbu.Remove(3) == "014" ? "71" : "51";
            }
        }

        internal string IdForBank
        {
            get
            {
                return TextDebitParserFormatter.StringFormat(this.customer.IdForBank, 22, ' ', false);
            }
        }

        internal string Cbu
        {
            get
            {
                return TextDebitParserFormatter.StringFormat(this.customer.Cbu, 22, '0', true);
            }
        }

        internal string Area
        {
            get
            {
                return this.areaParser.DebitUnivocalReference;
            }
        }
    }
}
